import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';

class SettingPage extends StatefulWidget {
  const SettingPage({super.key, required this.title});
  final String title;
  @override
  State<SettingPage> createState() => _SettingPage();
}

class _SettingPage extends State<SettingPage> {
  final GFBottomSheetController controller = GFBottomSheetController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color.fromARGB(255, 237, 236, 236),
      appBar: BrnAppBar(
        title: Text(
          "設置",
          style: TextStyle(color: Colors.black),
        ),
        backgroundColor: Color.fromARGB(255, 237, 236, 236),
        // elevation: 1,
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            Container(
                height: 60,
                padding: EdgeInsets.only(left: 10, right: 10),
                decoration: BoxDecoration(
                    border: Border(
                        bottom: BorderSide(width: 1, color: Colors.black12))),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: [
                    GFButton(
                      onPressed: () {
                        // Navigator.pushNamed(context, "/test");
                      },
                      text: "asq3456922@126.com",
                      icon: Icon(
                        Icons.email_outlined,
                        color: Colors.white,
                      ),
                    ),
                  ],
                )),
            Container(
                height: 60,
                padding: EdgeInsets.only(left: 10, right: 10),
                decoration: BoxDecoration(
                    border: Border(
                        bottom: BorderSide(width: 1, color: Colors.black12))),
                child: Row(
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [Icon(Icons.settings), Text("主題設置")],
                    ),
                    Container(
                      margin: EdgeInsets.only(left: 240),
                      child: IconButton(
                          onPressed: () {
                            Navigator.pushNamed(context, "/theme");
                          },
                          icon: Icon(Icons.arrow_forward_ios,
                              color: Color.fromARGB(133, 122, 122, 122))),
                    )
                  ],
                )),
            Container(
                height: 60,
                padding: EdgeInsets.only(left: 10, right: 10),
                decoration: BoxDecoration(
                    border: Border(
                        bottom: BorderSide(width: 1, color: Colors.black12))),
                child: Row(
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [Icon(Icons.music_note), Text("按鍵音設置")],
                    ),
                    Container(
                        margin: EdgeInsets.only(left: 225),
                        child: IconButton(
                            onPressed: () {
                              Navigator.pushNamed(context, "/keySound");
                            },
                            icon: Icon(Icons.arrow_forward_ios,
                                color: Color.fromARGB(133, 122, 122, 122))))
                  ],
                )),
            Container(
                height: 60,
                padding: EdgeInsets.only(left: 10, right: 10),
                decoration: BoxDecoration(
                    border: Border(
                        bottom: BorderSide(width: 1, color: Colors.black12))),
                child: Row(
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: [Icon(Icons.access_time_filled), Text("關於")],
                    ),
                    Container(
                        margin: EdgeInsets.only(left: 265),
                        child: IconButton(
                            onPressed: () {
                              Navigator.pushNamed(context, "/about");
                            },
                            icon: Icon(Icons.arrow_forward_ios,
                                color: Color.fromARGB(133, 122, 122, 122))))
                  ],
                )),
          ],
        ),
      ),

      // 說明
      bottomSheet: GFBottomSheet(
        controller: controller,
        animationDuration: 500,
        stickyHeader: Container(
          padding: EdgeInsets.only(top: 15),
          child: Text(
            "說明",
            textAlign: TextAlign.end,
          ),
        ),
        stickyHeaderHeight: 50,
        contentBody: Container(
          height: 250,
          margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
          child: ListView(
            shrinkWrap: true,
            physics: const ScrollPhysics(),
            children: const [
              Center(
                  child: Text(
                '該應用程序為計算器功能，僅提供學習交流之用，。\n開發：AAz',
                style: TextStyle(
                    fontSize: 15, wordSpacing: 0.3, letterSpacing: 0.2),
              ))
            ],
          ),
        ),
      ),
    );
  }
}
